package Polymorphism06;

public class Demo {
    public static void main(String[] args) {
        //method01();
        Person p = new Person();
        Cat cat = new Cat();
        Bird bird = new Bird();
        Dog dog = new Dog();
        Pig pig = new Pig();
        p.feed(cat);
        p.feed(bird);
        p.jidu(dog);
        p.jidu(pig);
    }
//第一种方案的测试
   private static void method01() {
        Person p = new Person();
        Cat c2 = new Cat();
        p.feed(c2);
        System.out.println("-----------");
        Bird b = new Bird();
        p.feed(b);
    }
}
